<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="now" value="<%=new java.util.Date()%>" />
<html>
 <script language="javascript" type="text/javascript" src="${ctxStatic}/My97DatePicker/WdatePicker.js"></script>
<head>
	<title>众筹项目管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			var endDate1 =$("#endDate1").html();
			var endDate = new Date(endDate1)
			var realEndDate = new Date((endDate/1000+86400)*1000);
			var now = new Date();
          if(now>realEndDate){
        	  $("#endTag").css("display","none");
          }
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
				
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bttk/tUserCrowdProject/">众筹项目列表</a></li>
		<shiro:hasPermission name="bttk:tUserCrowdProject:edit"><li><a href="${ctx}/bttk/tUserCrowdProject/form">众筹项目添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="tUserCrowdProject" action="${ctx}/bttk/tUserCrowdProject/list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>项目名称：</label><form:input path="projectName" htmlEscape="false" maxlength="255" class="input-medium"/></li>
			<li><label>开始日期：</label><form:input path="startDate" htmlEscape="false" onfocus="WdatePicker({dateFmt:'yyyy/MM/dd',isShowWeek:true})"  class="input-medium"/></li>
			<li><label>结束日期：</label><form:input path="endDate" htmlEscape="false"  onfocus="WdatePicker({dateFmt:'yyyy/MM/dd',isShowWeek:true})" class="input-medium"/></li></li>
			<li><label>商品众筹价：</label><form:input path="totalPrice" htmlEscape="false" maxlength="10" class="input-medium"/></li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询" onclick="return page();"/>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<a href="${ctx}/bttk/tUserCrowdProject/add"><input  class="btn btn-primary" value="新增众筹项目" /></a>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
			    <th>众筹项目名称</th><th>商品众筹价</th><th>发起价格</th><th>帮助人数</th><th>帮助金额</th><th>开始时间</th><th>结束时间</th><th>已发起人数</th><th>已帮筹人数</th>
				<shiro:hasPermission name="bttk:tUserCrowdProject:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tUserCrowdProject">
			<tr>
			    <td>${tUserCrowdProject.projectName}</td>
				<td>${tUserCrowdProject.totalPrice}</td>
				<td>${tUserCrowdProject.launchPrice}</td>
				<td>${tUserCrowdProject.helpAmount}</td>
				<td>${tUserCrowdProject.helpPrice}</td>		
				<td><fmt:formatDate value="${tUserCrowdProject.startDate}"  pattern="yyyy/MM/dd" /></td>
				<td id="endDate1"><fmt:formatDate value="${tUserCrowdProject.endDate}"  pattern="yyyy/MM/dd" /></td>
				<td>${tUserCrowdProject.totalLaunchAmount}</td>
				<td>${tUserCrowdProject.totalHelpAmount}</td>
<%-- 				<shiro:hasPermission name="bttk:tUserCrowdProject:edit"> --%>
				<td>
				    <a href="${ctx}/bttk/tUserCrowdProject/form?id=${tUserCrowdProject.id}">查看</a>
    				<a href="${ctx}/bttk/tUserCrowdProject/form?id=${tUserCrowdProject.id}">修改</a>
					<a id="endTag" href="${ctx}/bttk/tUserCrowdProject/delete?id=${tUserCrowdProject.id}" onclick="return confirmx('确认要结束该众筹项目吗？', this.href)">结束</a>
				</td>
<%-- 				</shiro:hasPermission> --%>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>